<?php
	include '../ini.php';
	include '../../libraries/my_pager.php';
	$dt_phan_trang=new my_pager;
	include '../../libraries/xl_thanh_vien.php';
	$dt_xl_thanh_vien=new xl_thanh_vien;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include'../widgets/js_css.php'?>
</head>
<body>
<div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
  
  <?php include '../widgets/sidebar.php'?>
  <div id="main-content"> <!-- Main Content Section with everything -->
  <!--noscript-->
    <!-- Page Head --> 
    <!-- End .shortcut-buttons-set -->
    
    <div class="clear"></div>
    <!-- End .clear -->
    
    <div class="content-box"><!-- Start Content Box -->
      
      <div class="content-box-header">
        <h3>Danh sách thành viên</h3>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
          <?php thong_bao()?>
          <table>
            <thead>
              <tr>
                <th>Mã</th>
                <th>Họ và Tên</th>
                <th>Tên đăng nhập</th>
                <th>Địa chỉ</th>
                <th>Email</th>
                <th>Điện thoại</th>
                <th>Trạng thái</th>
              </tr>
            </thead>
            <tfoot>
              <tr>
                <td colspan="6"><div class="pagination">
                    <?php
                        $tong_so_thanh_vien=$dt_xl_thanh_vien->so_luong();
                        $tong_so_trang=$dt_phan_trang->tong_so_trang($tong_so_thanh_vien,ADMIN_LIMIT);
                        if($tong_so_thanh_vien > ADMIN_LIMIT)
							echo $dt_phan_trang->xuat_phan_trang_admin($_GET['page'],$tong_so_trang);
                    ?>
                  </div>
                  <div class="clear"></div></td>
              </tr>
            </tfoot>
            <tbody>
              <?php
				$vi_tri=$dt_phan_trang->vi_tri(ADMIN_LIMIT);
				$ds_thanh_vien=$dt_xl_thanh_vien->danh_sach($vi_tri,ADMIN_LIMIT);
				foreach($ds_thanh_vien as $thanh_vien)
				{
			  ?>
              <tr>
                <td><?php echo $thanh_vien['ma']?></td>
                <td><?php echo $thanh_vien['ho_ten']?></td>
                <td><?php echo $thanh_vien['ten_dang_nhap']?></td>
                <td><?php echo $thanh_vien['dia_chi']?></td>
                <td><?php echo $thanh_vien['email']?></td>
                <td><?php echo $thanh_vien['dien_thoai']?></td>
                <td><a title="<?php if($thanh_vien['trang_thai']==1) echo 'Tắt (khóa tài khoản)'; else echo 'Bật (cho phép đăng nhập)';?>" href="cap_nhat_tt.php?ma=<?php echo $thanh_vien['ma']?>"><img src="../hinh_anh/trangthai_<?php echo $thanh_vien['trang_thai']?>.png" /></a></td>
              </tr>
              <?php }?>
            </tbody>
          </table>
        </div>
        <!-- End #tab1 --> 
        
      </div>
      <!-- End .content-box-content --> 
      
    </div>
    <!-- End .content-box -->
    
    <div class="clear"></div>
    <div id="footer"> <small> <!-- Remove this notice or replace it with whatever you want -->
    <!-- End #footer --> 
    
  </div>
  <!-- End #main-content --> 
</div>
</body>
</html>
